package com.kqb.common.core.exception;

import com.kqb.common.core.enums.ResponseEnum;

/**
 * @author 杉果树皮
 * @date 2025/4/12 15:50
 * @description: 统一异常类
 */
public class ScException extends RuntimeException {
    private static final long serialVersionUID = 1L;

    private Object object;

    private ResponseEnum responseEnum;

    public ScException(String msg) {
        super(msg);
    }

    public ScException(String msg, Object object) {
        super(msg);
        this.object = object;

    }

    public ScException(String msg, Throwable cause) {
        super(msg, cause);

    }

    public ScException(ResponseEnum responseEnum) {
        super(responseEnum.getMsg());
        this.responseEnum = responseEnum;
    }

    public ScException(Object object, ResponseEnum responseEnum) {
        super(responseEnum.getMsg());
        this.object = object;
        this.responseEnum = responseEnum;
    }

    public Object getObject() {
        return object;
    }

    public ResponseEnum getResponseEnum() {
        return responseEnum;
    }

}
